
import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/views/Layout/index.vue'
import Login from '@/views/Login/index.vue'
import Category from '@/views/Category/index.vue'
import Home from '@/views/Home/index.vue'
import Good from '@/views/Good/index.vue'
const routes = [
  {
    path: '/',
    component: Layout,
    children: [{
      path: 'category/:id',
      component: Category
    },
    {
      path: '',
      component: Home
    },
    {
      path: 'good/:id',
      component: Good
    }
    ]
  },
  {
    path: '/login',
    component: Login
  }
]
// 路由实例化
const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
